
package com.ailot.cloud.mall.dto;

import com.ailot.cloud.mall.entity.GoodsCategory;
import com.ailot.cloud.upms.common.dto.TreeNode;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * 商品类目树
 *
 * @date 2019-08-12 11:46:28
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class GoodsCategoryTree extends TreeNode {

    /**
     * 父分类编号
     */
    private String parentId;
    /**
     * 名称
     */
    private String name;
    /**
     * 描述
     */
    private String description;
    /**
     * 图片
     */
    private String picUrl;
    /**
     * 排序
     */
    private Integer sort;
    /**
     * 创建时间
     */
    private LocalDateTime createTime;
    /**
     * 最后更新时间
     */
    private LocalDateTime updateTime;


    public GoodsCategoryTree() {
    }

    public GoodsCategoryTree(GoodsCategory goodsCategory) {
        this.id = goodsCategory.getId();
        this.name = goodsCategory.getName();
        this.parentId = goodsCategory.getParentId();
        this.description = goodsCategory.getDescription();
        this.picUrl = goodsCategory.getPicUrl();
        this.sort = goodsCategory.getSort();
        this.createTime = goodsCategory.getCreateTime();
        this.updateTime = goodsCategory.getUpdateTime();
    }
}
